$(function(){
	var aln =0;
	if(document.documentElement.clientWidth<1200){
		aln =2;
//		document.documentElement.style.fontSize = document.documentElement.clientWidth / 750*100 + 'px';
		//document.documentElement.style.fontSize = 750 / 750*100 + 'px';
		$(".phone").on("click",function(){
			$(".nav").slideToggle(300);
		});
		
		
		//if(document.documentElement.clientWidth<750){
			var b =document.documentElement.clientWidth/750;
			var x =$("body").width()*(1-b);
			var y =$("body").height()/2;
			$("body").css({"width":"7.50rem"});
			$("html").css({"transform-origin":"0 0"});
			$("html").css({"transform":"scale("+b+","+b+")"});

			$(".dhhm").css({"top": $(window).scrollTop()/b+$(window).height()+"px"});

			setTimeout(function(){
				$("#nb_icon_wrap").css({width:"150px",height:"150px"});
				$("#nb_icon_wrap").css({right:"-100%",top: $(window).scrollTop()/b+600+"px"});
				$("#nb_icon_wrap .nb-icon-wrap-base").css({"background-size":"100px"});
				$("#nb_invite_wrap .nb-invite-welcom").css({"font-size":"20px"});
				$("#nb_invite_wrap .nb-invite-ok").css({"font-size":"20px"});
				$("#nb_invite_wrap .nb-invite-no").css({"font-size":"20px"});
				$("#nb_invite_wrap").css({width:$(window).width()/b,height:"150px"});
			},1000);
			
			$(window).on("scroll",function(ev){
				var ev =ev||window.event;

				$(".dhhm").css({"top": $(window).scrollTop()/b+700+"px"});
				$("#nb_icon_wrap").css({"top": $(window).scrollTop()/b+600+"px"});
				if($(window).scrollTop()+$(window).height()>$("html").height()*b){
					$('html, body').animate({scrollTop: $("html").height()*b-$(window).height()},0);
				}
//				if()
			})
		//}
	}else{
		aln =3;
		$(".banner,.celebrate").css({"width":$(window).width()})
	}
		//alert($(".about").width()+"-"+$(".about .center").width()+"-"+$(".about .content-content").width()+"-"+$(".about p").width())
	//nav点击换页
	$(".nav").on("click","div",function(){
		window.location.href ="./"+$(this).attr("href");
	})
	//数据请求
	//banner图请求
	$.ajax({
		url: "/zqedu/rest/bannerlistController.do?allBannerlist&id=bannerlist",
		type: "get",
		dataType:"json"
	}).done(function(result){
		var data =result.obj;
		var banner ="";
		
		for(var i=0;i<data.length;i++){
			var tmp =data[i];
			banner +='<div class="swiper-slide"><img src="./'+tmp.bannerpath+'"/></div>';
		}
		
		$(".ban .swiper-banner .swiper-wrapper").html(banner);
		
		//banner图初始化
		var banner = new Swiper ('.swiper-banner', {
		    loop: true,
		    autoplay: {
		    	delay:5000,
		    },
		    // 如果需要分页器
		    pagination: {
		      el: '.swiper-banp',
		    },
	
		});
		//鼠标覆盖停止自动切换
		banner.el.onmouseover = function(){
		  	banner.autoplay.stop();
		}
		//鼠标覆盖停止自动切换
		banner.el.onmouseleave = function(){
		  	banner.autoplay.start();
		}
	});

});
